package WebCrawler

import "regexp"

type regExp struct {
}

func (e *regExp) FindWebTexts(els []*WebElement, reg *regexp.Regexp) []*WebElement {
	list := make([]*WebElement, 0)
	for _, node := range els {
		matches := reg.FindAllString(node.Text, -1)
		if len(matches) > 0 {
			list = append(list, node)
		}
	}

	return list
}
